<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>新用户注册页面</title>
    <link type="text/css" rel="stylesheet" href="css/register.css" />
</head>

<body>
<div id="header"><img src="images/register_logo.gif" alt="logo"/></div>
<div id="main">
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
            <td class="bg bg_top_left"></td>
            <td class="bg_top"></td>
            <td class="bg bg_top_right"></td>
        </tr>
        <tr>
            <td class="bg_left"></td>
            <td class="content">
                <form id="registerForm" action="" method="post" name="myform" onsubmit="return dianji() ">
                    <dl>
                        <dt>通行证用户名：</dt>
                        <dd><input type="text" id="userName" class="inputs userWidth" onblur="tishi()" /> @163.com</dd>
                        <div id="userNameId" class="" name="not"></div>
                    </dl>
                    <dl>
                        <dt>登录密码：</dt>
                        <dd><input type="password" id="pwd" class="inputs" onblur="mima()"/></dd>
                        <div id="pwdId" class="" name="not"  ></div>
                    </dl>
                    <dl>
                        <dt>重复登录密码：</dt>
                        <dd><input type="password" id="repwd" class="inputs" onblur="mima1()"/></dd>
                        <div id="repwdId" name="not" class=""></div>
                    </dl>
                    <dl>
                        <dt>性别：</dt>
                        <dd><input name="sex" type="radio" value="" checked="checked"/>男 <input name="sex" type="radio" value="" />女 </dd>
                    </dl>
                    <dl>
                        <dt>真实姓名：</dt>
                        <dd><input type="text" id="realName" class="inputs" /></dd>
                    </dl>
                    <dl>
                        <dt>昵称：</dt>
                        <dd><input type="text" id="nickName" class="inputs" onblur="nicheng()"/></dd>
                        <div id="nickNameId"></div>
                    </dl>
                    <dl>
                        <dt>关联手机号：</dt>
                        <dd><input type="text" id="tel" class="inputs" onblur="phoneNumber()"/></dd>
                        <div id="telId"></div>
                    </dl>
                    <dl>
                        <dt>保密邮箱：</dt>
                        <dd><input type="text" id="email" class="inputs" onblur="emails()"/></dd>
                        <div id="emailId"></div>
                    </dl>
                    <dl>
                        <dt></dt>
                        <dd><input name=" " type="image" src="images/button.gif" onclick="dianji()"/></dd>
                    </dl>
                </form>
            </td>
            <td class="bg_right"></td>
        </tr>
        <tr>
            <td class="bg bg_end_left"></td>
            <td class="bg_end"></td>
            <td class="bg bg_end_right"></td>
        </tr>
    </table>
</div>
<script type="text/javascript">
    function tishi() {
        d=document.getElementById("userName").value
        c=document.getElementById("userNameId")
        if (!d){
            c.className="error_prompt"
            c.innerHTML="同行证用户名不能为空,请输入通行证用户名"
            return false
        }else{
            c.className="ok_prompt"
            c.innerHTML="通行证用户名正确输入正确"
            return true
        }
    }
    function mima() {
        d=document.getElementById("pwd").value
        c=document.getElementById("pwdId")
        if (!d){
            c.className="error_prompt"
            c.innerHTML="密码不能为空,请重新输入密码"
            return false;
        }else{
            c.className="ok_prompt"
            c.innerHTML="密码输入正确"
            return  true;
        }
    }
    function mima1() {
        d=document.getElementById("repwd").value
        c=document.getElementById("repwdId")
        e=document.getElementById("pwd").value
        console.log(e)
        console.log(d)
        if (!e){
            c.className="error_prompt"
            c.innerHTML="重复密码不能为空,请重复输入密码"
        }else{
            if (e==d){
            c.className="ok_prompt"
            c.innerHTML="两次密码输入正确"
            }
        }
    }
    function nicheng() {
        d=document.getElementById("nickName").value
        c=document.getElementById("nickNameId")
        if (!d){
            c.className="error_prompt"
            c.innerHTML="昵称不能为空，请输入昵称"
        }else{
            c.className="ok_prompt"
            c.innerHTML="昵称输入正确"
        }
    }
    function phoneNumber() {
        d=document.getElementById("tel").value
        c=document.getElementById("telId")
        console.log(isNaN(d))
        if (!d){
            c.className="error_prompt"
            c.innerHTML="关联手机号码不能为空，请输入关联手机号码"
        }else{
            if (!isNaN(d)){
                if (d.length == 11){
                    c.className="ok_prompt"
                    c.innerHTML="关联手机号输入正确"
                }
            }
        }
    }
    function emails(){
        d=document.getElementById("email").value
        c=document.getElementById("emailId")
        if (!d){
            c.className="error_prompt"
            c.innerHTML="保密邮箱不能为空 请输入保密邮箱"
        }else{
            if (d.lastIndexOf("@qq.com")){
                    c.className="ok_prompt"
                    c.innerHTML="保密邮箱输入正确"
            }
        }
    }
    function dianji() {
        return mima()&&tishi()&&nicheng()&&mima1()&&phoneNumber()&&emails()
    }
</script>
</body>
</html>
